#[cfg(test)]
mod tests {
    #[test]
    fn iterator_dome() {
        let v1 = vec![4, 5, 6];
        let mut v1_iter = v1.iter();

        assert_eq!(v1_iter.next(), Some(&4));
        assert_eq!(v1_iter.next(), Some(&5));
        assert_eq!(v1_iter.next(), Some(&6));
        assert_eq!(v1_iter.next(), None);
    }

    #[test]
    fn iterator_sum() {
        let v1 = vec![1, 3, 4];
        let v1_iter = v1.iter();

        let total: i32 = v1_iter.sum();

        assert_eq!(total, 8);
    }

    #[test]
    fn iterator_map() {
        let v1 = vec![1, 2, 3];
        let v2: Vec<_> = v1.iter().map(|x| x + 2).collect();

        assert_eq!(v2, vec![3, 4, 5]);
    }
}
